package org.dxj.restaurantmanagementsystem.views;

import org.dxj.restaurantmanagementsystem.controller.UserController;
import org.dxj.restaurantmanagementsystem.entity.User;

import java.io.IOException;
import java.util.Scanner;

/**
 * @author Ding
 * @date 2019/11/23 20:07
 */
public class UserViews {
  private UserController userController=new UserController();
    public void userView() throws IOException {
        Scanner scanner=new Scanner(System.in);
        System.out.println("欢迎进入用户界面：");
        System.out.println("请输入用户id：");
        Integer id=scanner.nextInt();
        System.out.println("请输入用户名：");
        String userName=scanner.next();
        System.out.println("请输入密码：");
        String password=scanner.next();
        System.out.println("请输入密保问题：");
        String question=scanner.next();
        System.out.println("请输入密保答案：");
        String answer=scanner.next();
        System.out.println("请输入用户权限：");
        Integer level=scanner.nextInt();
        User user=new User(id,userName,password,question,answer,level);
        userController.insertUserController(user);
    }
}
